package com.eduhzy.ttw.commonsdk.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author xubo
 * @date 2018/7/30 14:41
 */
public class EntriesDetailData implements Parcelable {

    /**
     * attachmentList : [{"attachType":637,"displayName":"《美丽的小兴安岭》学法指导（2）.DOC","fileName":"论文作品","fileSize":0,"id":6567,"objectId":6580,"previewAddr":"","remoteId":64050859785568256}]
     * awardLevel : 0
     * createTime : 1535011708000
     * fileType : 2
     * hasVoted : 0
     * img : http://192.168.0.108:8299/r/cms/www/yxs/img/word.jpg
     * pvCount : 3
     * researchId : 770
     * researchWorksNo : NO.1
     * status : 0
     * unionName : 管理员
     * unionUnit : 湖南省教育厅
     * voteCount : 1
     * worksId : 6580
     * worksName : 《美丽的小兴安岭》学法指导（2）
     * worksSN : SN20180824000828
     */
    private int isShare;
    private String telephone;
    private int awardLevel;
    private long createTime;
    /**
     * 文件格式 0：通用类，1，视频类，2：文档类，3：图片类，4：音频类5压缩文件(YXS：6我的资源 7我的备课 )
     */
    private int fileType;
    private int hasVoted;
    private String img;
    private int pvCount;
    private int researchId;
    private String researchWorksNo;
    private int status;
    private String unionName;
    private String unionUnit;
    private int voteCount;
    private int worksId;
    private String worksName;
    private String worksSN;
    private String shareLink;

    public String getShareLink() {
        return shareLink;
    }

    public void setShareLink(String shareLink) {
        this.shareLink = shareLink;
    }

    private List<AttachmentListBean> attachmentList;
    /**
     * userRight : {"couldUpdate":0,"couldUpload":0,"couldVote":0}
     */

    private UserRightBean userRight;

    public int getIsShare() {
        return isShare;
    }

    public void setIsShare(int isShare) {
        this.isShare = isShare;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public int getAwardLevel() {
        return awardLevel;
    }

    public void setAwardLevel(int awardLevel) {
        this.awardLevel = awardLevel;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public int getFileType() {
        return fileType;
    }

    public void setFileType(int fileType) {
        this.fileType = fileType;
    }

    public int getHasVoted() {
        return hasVoted;
    }

    public void setHasVoted(int hasVoted) {
        this.hasVoted = hasVoted;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public int getPvCount() {
        return pvCount;
    }

    public void setPvCount(int pvCount) {
        this.pvCount = pvCount;
    }

    public int getResearchId() {
        return researchId;
    }

    public void setResearchId(int researchId) {
        this.researchId = researchId;
    }

    public String getResearchWorksNo() {
        return researchWorksNo;
    }

    public void setResearchWorksNo(String researchWorksNo) {
        this.researchWorksNo = researchWorksNo;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getUnionName() {
        return unionName;
    }

    public void setUnionName(String unionName) {
        this.unionName = unionName;
    }

    public String getUnionUnit() {
        return unionUnit;
    }

    public void setUnionUnit(String unionUnit) {
        this.unionUnit = unionUnit;
    }

    public int getVoteCount() {
        return voteCount;
    }

    public void setVoteCount(int voteCount) {
        this.voteCount = voteCount;
    }

    public int getWorksId() {
        return worksId;
    }

    public void setWorksId(int worksId) {
        this.worksId = worksId;
    }

    public String getWorksName() {
        return worksName;
    }

    public void setWorksName(String worksName) {
        this.worksName = worksName;
    }

    public String getWorksSN() {
        return worksSN;
    }

    public void setWorksSN(String worksSN) {
        this.worksSN = worksSN;
    }

    public List<AttachmentListBean> getAttachmentList() {
        return attachmentList;
    }

    public void setAttachmentList(List<AttachmentListBean> attachmentList) {
        this.attachmentList = attachmentList;
    }

    public UserRightBean getUserRight() {
        return userRight;
    }

    public void setUserRight(UserRightBean userRight) {
        this.userRight = userRight;
    }

    public static class AttachmentListBean implements Parcelable {

        /**
         * attachType : 637
         * displayName : 《美丽的小兴安岭》学法指导（2）.DOC
         * fileName : 论文作品
         * fileSize : 0
         * id : 6567
         * objectId : 6580
         * previewAddr :
         * remoteId : 64050859785568256
         */
        private String img;
        private boolean showloading;
        private int attachType;
        private String displayName;
        private String resUrl;
        private String fileName;
        private int fileSize;
        private int id;
        private int objectId;
        private String previewAddr;
        private long remoteId;
        private boolean mPlay;

        public String getImg() {
            return img;
        }

        public void setImg(String img) {
            this.img = img;
        }

        public boolean isShowloading() {
            return showloading;
        }

        public void setShowloading(boolean showloading) {
            this.showloading = showloading;
        }

        public boolean isPlay() {
            return mPlay;
        }

        public void setPlay(boolean play) {
            mPlay = play;
        }

        public String getResUrl() {
            return resUrl;
        }

        public void setResUrl(String resUrl) {
            this.resUrl = resUrl;
        }

        public int getAttachType() {
            return attachType;
        }

        public void setAttachType(int attachType) {
            this.attachType = attachType;
        }

        public String getDisplayName() {
            return displayName;
        }

        public void setDisplayName(String displayName) {
            this.displayName = displayName;
        }

        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public int getFileSize() {
            return fileSize;
        }

        public void setFileSize(int fileSize) {
            this.fileSize = fileSize;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getObjectId() {
            return objectId;
        }

        public void setObjectId(int objectId) {
            this.objectId = objectId;
        }

        public String getPreviewAddr() {
            return previewAddr;
        }

        public void setPreviewAddr(String previewAddr) {
            this.previewAddr = previewAddr;
        }

        public long getRemoteId() {
            return remoteId;
        }

        public void setRemoteId(long remoteId) {
            this.remoteId = remoteId;
        }

        public AttachmentListBean() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.attachType);
            dest.writeString(this.displayName);
            dest.writeString(this.resUrl);
            dest.writeString(this.fileName);
            dest.writeInt(this.fileSize);
            dest.writeInt(this.id);
            dest.writeInt(this.objectId);
            dest.writeString(this.previewAddr);
            dest.writeLong(this.remoteId);
            dest.writeByte(this.mPlay ? (byte) 1 : (byte) 0);
        }

        protected AttachmentListBean(Parcel in) {
            this.attachType = in.readInt();
            this.displayName = in.readString();
            this.resUrl = in.readString();
            this.fileName = in.readString();
            this.fileSize = in.readInt();
            this.id = in.readInt();
            this.objectId = in.readInt();
            this.previewAddr = in.readString();
            this.remoteId = in.readLong();
            this.mPlay = in.readByte() != 0;
        }

        public static final Creator<AttachmentListBean> CREATOR = new Creator<AttachmentListBean>() {
            @Override
            public AttachmentListBean createFromParcel(Parcel source) {
                return new AttachmentListBean(source);
            }

            @Override
            public AttachmentListBean[] newArray(int size) {
                return new AttachmentListBean[size];
            }
        };
    }

    public EntriesDetailData() {
    }

    public static class UserRightBean implements Parcelable {
        /**
         * couldUpdate : 0
         * couldUpload : 0
         * couldVote : 0
         */

        private int couldUpdate;
        private int couldUpload;
        private int couldVote;

        public int getCouldUpdate() {
            return couldUpdate;
        }

        public void setCouldUpdate(int couldUpdate) {
            this.couldUpdate = couldUpdate;
        }

        public int getCouldUpload() {
            return couldUpload;
        }

        public void setCouldUpload(int couldUpload) {
            this.couldUpload = couldUpload;
        }

        public int getCouldVote() {
            return couldVote;
        }

        public void setCouldVote(int couldVote) {
            this.couldVote = couldVote;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.couldUpdate);
            dest.writeInt(this.couldUpload);
            dest.writeInt(this.couldVote);
        }

        public UserRightBean() {
        }

        protected UserRightBean(Parcel in) {
            this.couldUpdate = in.readInt();
            this.couldUpload = in.readInt();
            this.couldVote = in.readInt();
        }

        public static final Creator<UserRightBean> CREATOR = new Creator<UserRightBean>() {
            @Override
            public UserRightBean createFromParcel(Parcel source) {
                return new UserRightBean(source);
            }

            @Override
            public UserRightBean[] newArray(int size) {
                return new UserRightBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.isShare);
        dest.writeString(this.telephone);
        dest.writeInt(this.awardLevel);
        dest.writeLong(this.createTime);
        dest.writeInt(this.fileType);
        dest.writeInt(this.hasVoted);
        dest.writeString(this.img);
        dest.writeInt(this.pvCount);
        dest.writeInt(this.researchId);
        dest.writeString(this.researchWorksNo);
        dest.writeInt(this.status);
        dest.writeString(this.unionName);
        dest.writeString(this.unionUnit);
        dest.writeInt(this.voteCount);
        dest.writeInt(this.worksId);
        dest.writeString(this.worksName);
        dest.writeString(this.worksSN);
        dest.writeString(this.shareLink);
        dest.writeTypedList(this.attachmentList);
        dest.writeParcelable(this.userRight, flags);
    }

    protected EntriesDetailData(Parcel in) {
        this.isShare = in.readInt();
        this.telephone = in.readString();
        this.awardLevel = in.readInt();
        this.createTime = in.readLong();
        this.fileType = in.readInt();
        this.hasVoted = in.readInt();
        this.img = in.readString();
        this.pvCount = in.readInt();
        this.researchId = in.readInt();
        this.researchWorksNo = in.readString();
        this.status = in.readInt();
        this.unionName = in.readString();
        this.unionUnit = in.readString();
        this.voteCount = in.readInt();
        this.worksId = in.readInt();
        this.worksName = in.readString();
        this.worksSN = in.readString();
        this.shareLink = in.readString();
        this.attachmentList = in.createTypedArrayList(AttachmentListBean.CREATOR);
        this.userRight = in.readParcelable(UserRightBean.class.getClassLoader());
    }

    public static final Creator<EntriesDetailData> CREATOR = new Creator<EntriesDetailData>() {
        @Override
        public EntriesDetailData createFromParcel(Parcel source) {
            return new EntriesDetailData(source);
        }

        @Override
        public EntriesDetailData[] newArray(int size) {
            return new EntriesDetailData[size];
        }
    };
}
